﻿@using ChGK.Data;

@{
    ViewBag.Title = "Страница команды";
    Layout = "~/Views/Shared/_LayoutUser.cshtml";
}

<style type = "text/css">
div#Green
{
    color: Green;
}

div#Red
{
    color: Red;
}
</style>

<h2>Команда "@ViewData["Team"]"</h2>
<p>
Тур @ViewData["TourNumber"], Вопрос @ViewData["Question"]
</p>

@using (Html.BeginForm())
{
    <p>
        @Html.Hidden("Team",@ViewData["Team"])
    </p>
    <p>
        @Html.Hidden("TourNumber", @ViewData["TourNumber"])
    </p>
    <p>
        @Html.Hidden("TourID", @ViewData["TourID"])
    </p>
    <p>
        @Html.Hidden("Question", @ViewData["Question"])
    </p>
    
    <p>
        Ваш ответ: <br />
        @Html.TextArea("Answer")  @Html.ValidationMessage("Answer")
        <input type="submit", value="Ответить" />
    </p>
    
        
    
}

<br />
<br />
@foreach (Answer a in (IEnumerable<Answer>)ViewData["Answers"])
{
    if (a.IsCorrect == null)
    {
        <div>
            @a.Value
        </div>
    }
    else if (a.IsCorrect == false)
    {
        <div id = "Red">
            @a.Value
        </div>
    }
    else
    {
        <div id = "Green">
            @a.Value
        </div>
    }
}
